package com.gxl.design.filterpattern.impl;

import com.gxl.design.filterpattern.Car;
import com.gxl.design.filterpattern.Criteria;

import java.util.ArrayList;
import java.util.List;

/**
 * @remark --
 * @author: GuoXiaolin
 * @date 2019/4/19 11:02
 * @Version 1.0
 * @Derction
 */
public class AudiCriteria implements Criteria {
    @Override
    public List<Car> meetCriteria(List<Car> carList) {
        List<Car> list = new ArrayList<>();
        for (Car car : carList) {
            if (car.getName().equals("Audi")){
                list.add(car);
            }
        }
        return list;
    }
}
